import request from '@/utils/request'

// 查询书籍的分类配置列表
export function listBookcategory(query) {
  return request({
    // url: '/system/bookcategory/list',
    url: '/system/bookcategory/find/list',
    method: 'get',
    params: query
  })
}

// 查询书籍的分类配置详细
export function getBookcategory(id) {
  return request({
    url: '/system/bookcategory/' + id,
    // url: '/system/bookcategory/find/book/' + id,
    method: 'get'
  })
}

// 新增书籍的分类配置
export function addBookcategory(data) {
  return request({
    url: '/system/bookcategory',
    method: 'post',
    data: data
  })
}

// 修改书籍的分类配置
export function updateBookcategory(data) {
  return request({
    url: '/system/bookcategory',
    method: 'put',
    data: data
  })
}

// 删除书籍的分类配置
export function delBookcategory(id) {
  return request({
    url: '/system/bookcategory/' + id,
    method: 'delete'
  })
}

//查询书籍分类下的书籍
export function getBook(id) {
  return request({
    url: '/system/bookcategory/find/book/' + id,
    method: 'post'
  })
}